package com.douxg.fastCoding.spring.util;

import cn.hutool.core.util.StrUtil;
import com.douxg.fastCoding.spring.consts.BizCode;
import com.douxg.fastCoding.spring.exception.BizRuntimeException;

/**
 * @Description
 * @Auther douxg
 * @Date 2020/7/31 11:24
 */
public class CheckUtil {
    public static void isNull(CharSequence value) {
        if (value == null) {
            throw new BizRuntimeException(BizCode.PARAM_ISNULL);
        }
    }

    public static void isEmpty(CharSequence value) {
        if (StrUtil.isEmpty(value)) {
            throw new BizRuntimeException(BizCode.PARAM_ISNULL);
        }
    }

    public static void isBlank(CharSequence value) {
        if (StrUtil.isBlank(value)) {
            throw new BizRuntimeException(BizCode.PARAM_ISNULL);
        }
    }
}
